package com.foreknow.test;

import com.foreknow.model.Admin;
import com.foreknow.util.GsonUtil;

import java.util.ArrayList;
import java.util.List;

public class GSON {
    public static void main(String[] args) {
        Admin admin =new Admin();
        admin.setId(1);
        admin.setUsername("tom");
        admin.setPassword("123");

        Admin admin1 =new Admin();
        admin.setId(2);
        admin.setUsername("tom2");
        admin.setPassword("222");

        List<Admin> list = new ArrayList<>();
        list.add(admin);
        list.add(admin1);
        String json = GsonUtil.bean2Json(list);
        System.out.println(json);

    }
}
